const VERSION = "v1.1.9 build:202203120047"; // 版本号

//获取正式测试环境
const ENV = process.env.NODE_ENV; // 'development'为开发环境, 'production'为产品环境
const APPID = CURRENT_APPID; //小程序appid
const FWH_APPID = "wx1659f37683e9d6fb";//服务号appid
const OPEN_APPID = "xxx";//开放平台appid

let BASE_URL = "", WS_ROOT = "";

// iM配置参数
const IM_CONF = {
  SDKAPPID: 0
},
  COS_CONF = {
    BUCKET: "",
    REGION: ""
  },
  // 云开发配置参数
  WXCLOUD_CONF = {
    ENV: ""
  };

switch (ENV) {
  case "production": // 产品环境 build
    // 默认为开发环境
    IM_CONF.SDKAPPID = 1400548339;
    COS_CONF.BUCKET = "leconglive-wxapp-1301839528";
    COS_CONF.REGION = "ap-guangzhou";
    BASE_URL = "https://test.zhiyan.live";
    WS_ROOT = "ws://";

    switch (APPID) {
      case "wxaf33ac72738545d7": //乐从
        WXCLOUD_CONF.ENV = "lecongprod-8g84z6vd1307d95b";
        break;
      case "wxc13e52a5dc2a32de": //乐盐
        WXCLOUD_CONF.ENV = "leyanprod-3gyqpazf6eb1f0ca";
        break;
      case "wx5abd6ad5cd857692": //直盐或者其他
      default:
        WXCLOUD_CONF.ENV = "zhiyanprod-idts2";
        break;
    }

    break;

  case "development": // 测试环境
  default:
    // IM_CONF.SDKAPPID = 1400537350;
    // COS_CONF.BUCKET = "leconglive-wxapp-1301839528";
    // COS_CONF.REGION = "ap-guangzhou";
    // BASE_URL = "http://192.168.10.55";
    // WS_ROOT = "ws://";
    // break;

    IM_CONF.SDKAPPID = 1400548339;
    COS_CONF.BUCKET = "leconglive-wxapp-1301839528";
    COS_CONF.REGION = "ap-guangzhou";
    BASE_URL = "https://test.zhiyan.live";
    WS_ROOT = "ws://";

    //测试环境专用的云开发账号
    switch (APPID) {
      case "wxaf33ac72738545d7": //乐从
        WXCLOUD_CONF.ENV = "lecongdev-8g8me481c847c684";
        break;
      case "wxc13e52a5dc2a32de": //乐盐
        WXCLOUD_CONF.ENV = "leyandev-1g4tc8ukdfb21be0";
        break;
      case "wx5abd6ad5cd857692": //直盐或者其他
      default:
        WXCLOUD_CONF.ENV = "zhiyantest-74ljd";
        break;
    }
    break;
}

export default {
  ENV,
  VERSION,
  APPID,
  FWH_APPID,
  OPEN_APPID,
  BASE_URL,
  WS_ROOT,
  IM_CONF,
  COS_CONF,
  WXCLOUD_CONF
};
